<template>
  <v-container>
    <v-btn @click="start">开始</v-btn>
    <v-progress-linear v-if="isLoading" v-model="progress" color="primary" height="10">
      <strong>{{ Math.round(progress) }}%</strong>
    </v-progress-linear>
  </v-container>
</template>

<script>
export default {
  name: 'BackGround',
  data() {
    return {
      isLoading: false,
      progress: 0
    };
  },
  methods: {
    start() {
      this.isLoading = true;
      this.progress = 0;
      const interval = setInterval(() => {
        this.progress += 10;
        if (this.progress >= 100) {
          clearInterval(interval);
          this.isLoading = false;
        }
      }, 500);
    }
  }
};
</script>